<?php
	
	require_once '../conn/conn.class.php';

	$myDb = new conn('127.0.0.1','root','root','phplogin');
	@$user=$_GET['user'];
	@$email=$_GET['email'];
	@$action=$_GET['action'];
	switch ($action){
        case 1:
            $sql="select * from tb_register where user='".$user."'";
            if($myDb->mysqli_get_rows($sql)===0){
                echo "1";
            }elseif ($myDb->mysqli_get_rows($sql)===1) {
                echo "2";
            }else{
                echo "connec default";
            }
            $myDb->close_rst();
            $myDb->close_mysql();
            break;
        case 2:
            $sql="select * from tb_register where email='".$email."'";
            if($myDb->mysqli_get_rows($sql)===0){
                echo "1";
            }elseif ($myDb->mysqli_get_rows($sql)===1) {
                echo "2";
            }else{
                echo "connec default";
            }
            $myDb->close_rst();
            $myDb->close_mysql();
            break;
        default:
            break;
    }
